using System;
using System.Collections.Generic;
using System.Text;

namespace NBusiness.CodeDom
{
    [Serializable]
	public abstract class EntityValidation : EntityRule
	{
		private IValidatable _validatable = null;
        public IValidatable Validatable
		{
			get { return _validatable; }
			set { _validatable = value; }
		}

        private EntityValidationType _type;
		public EntityValidationType Type
		{
			get { return _type; }
			set { _type = value; }
		}

		private List<string> _arguments = new List<string>();
		public List<string> Arguments
		{
			get { return _arguments; }
			set { _arguments = value; }
		}

		public override string ToString()
		{
			string val = string.Format("validate {0} {1}",
				_validatable,
				_type);

			foreach(string a in _arguments)
			{
				val += " " + a;
			}

			return val;
		}
	}
}
